/**
 * All rights reserved by www.xandroid.cn
 */
package xfok.net.xandroid.examples;

import xfok.net.xandroid.R;
import android.app.Activity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.Spinner;

/**
 * @author YangHua
 *  转载请注明出处：http://www.xfok.net/android/201005/14.html
 * 2010-5-20 www.xandroid.cn 
 */
public class Spinner1 extends Activity {
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.spinner);
        Spinner s1 = (Spinner) findViewById(R.id.spinner);
        ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(
                this, R.array.colors, android.R.layout.simple_spinner_item);
        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        s1.setAdapter(adapter);
    }
}
